package alp.starcode.framework.enums;

public enum ReturnEmun {

    SUCCESS(0, "OK"),
    USER_NOT_EXIST(1, "用户不存在..."),
    NOT_YOURSELF(2, "不能添加你自己..."),
    ALREADY_FRIENDS(3, "该用户已经是你的好友...");

    public final Integer status;

    public final String msg;

    ReturnEmun(Integer status, String msg) {
        this.status = status;
        this.msg=msg;
    }

    public Integer getStatus() {
        return status;
    }

    public String getMsg() {
        return msg;
    }

    public static String getMsgByKey(Integer status) {
        for (ReturnEmun type : ReturnEmun.values()) {
            if (type.getStatus() == status) {
                return type.msg;
            }
        }
        return null;
    }
}
